import Vue from 'vue'
Vue.filter('times', time => {
  time = new Date(time)
  var year = time.getFullYear()
  var month = time.getMonth() + 1
  var day = time.getDate()

  var hour = time.getHours()
  var min = time.getMinutes()
  var second = time.getSeconds()
  month = month > 9 ? month : '0' + month
  day = day > 9 ? day : '0' + day
  hour = hour > 9 ? hour : '0' + hour
  min = min > 9 ? min : '0' + min
  second = second > 9 ? second : '0' + second
  return year + '-' + month + '-' + day + ' ' + hour + ':' + min + ':' + second
})
Vue.filter('collect',(val,res)=>{
    for(var i =0;i<res.length;i++){
        if(val == res[i]){
            return true
        }
    }
})